home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: mozart.unx.sas.com!jamie
- From: jamie@cdevil.unx.sas.com (James Cooper)
- Subject: Re: C compiler problem
- Originator: jamie@cdevil.unx.sas.com
- Sender: news@unx.sas.com (Noter of Newsworthy Events)
- Message-ID: <DLzwG3.MDA@unx.sas.com>
- Date: Tue, 30 Jan 1996 13:07:15 GMT
- X-Nntp-Posting-Host: cdevil.unx.sas.com
- References: <4ek3b2$a5k@nntp.novia.net>
- Organization: SAS Institute Inc.
-
-
- In article <4ek3b2$a5k@nntp.novia.net>, tsyslo@oasis.novia.net (Tony Syslo) writes:
- >I have a friend who is converting a CNET BBS game from ARREX to C.
- >Here is his request:
- >
- >Can anyone tell me why this program is not compiling?
- >I am using SAS/C 6.50, and am getting a BPTR error on line 35 with the
- >"struct FileHandle *".
- >
- >PROGRAM START:
- >
- > struct FileHandle *file_handle;
-
- That's an easy one, which people are *still* having problems with, even
- after 10 years... is anyone actually reading the docs (RKM, etc.)?
-
- The dos.library calls (Open, Seek, Write, etc.) do ***NOT*** return or
- use a
-
- "struct FileHandle *"
-
- they need a
-
- "BPTR"
-
- The error message is exactly correct. The prototypes for these functions
- in the header file <clib/dos_protos.h> CORRECTLY list the types as BPTR,
- but your friend is attempting to use "struct FileHandle *" instead.
-
- If he changes the above declaration to
-
- BPTR file_handle;
-
- and removes all casts to (struct FileHandle *), the problem will be fixed.
-
- Now, indeed, if that BPTR is turned into a C pointer, it will point to a
- "struct FileHandle", but there's nothing in there that anyone should be
- messing with, anyway.
-
- --
- ---------------
- Jim Cooper
- (jamie@unx.sas.com) bix: jcooper
-
- Any opinions expressed herein are mine (Mine, all mine! Ha, ha, ha!),
- and not necessarily those of my employer.
-
- I'm NOT Politically Correct, but that's because I'm "Sensitivity Challenged."
-